public class TestDemo {

    public static void main(String[] args) {
        System.out.println(10 > 20 && 10 / 0 == 0); // 打印 false
        System.out.println(10 < 20 || 10 / 0 == 0); // 打印 true
    }
    public static void main21(String[] args) {
        int a = 10;
        int b = 20;
        // 注意：在Java中 = 表示赋值，要与数学中的含义区分
        // 在Java中 == 表示相等
        System.out.println(a == b); // false
        System.out.println(a != b); // true
        System.out.println(a < b); // true
        System.out.println(a > b); // false
        System.out.println(a <= b); // true
        System.out.println(a >= b); // false
      //  if (3 < a < 5) {
      //
      //  }

    }
    public static void main20(String[] args) {
        int a = 10;
        //int b = ++a; 11
        //int b = a++; 10
        System.out.println(a);
    }
    public static void main19(String[] args) {
        short a = 10;
        a +=20;//帮助我们进行自动的类型转换
        //a = a+20;
        System.out.println(a);
    }
    public static void main18(String[] args) {
        System.out.println(10%3);
        System.out.println(10%-3);
        System.out.println(-10%3);
        System.out.println(-10%-3);
        System.out.println("====================");
        System.out.println(11.5%10);
        //System.out.println(11.5%0);  未定义   NaN
    }

    public static void main17(String[] args) {
        System.out.println(5/2);//2
        System.out.println(5/(float)2);//2.5
        System.out.println((float)5/2);//2.5
        System.out.println((float)(5/2));//2.0
        //System.out.println(4/0);0不能作被除数
    }

    public static void main16(String[] args) {
        String str = "123";
        int ret = Integer.valueOf(str);
        System.out.println(ret);
    }
    public static void main15(String[] args) {
        int num1 = 10;
        String ret1 = num1+"";
        System.out.println(ret1);
        String ret2 = String.valueOf(num1);
        System.out.println(ret2);
    }
    public static void main14(String[] args) {
        String str = "hello";//字符串：双引号引起的若干个字符
        String str2 = "world";
        System.out.println(str+str2);//代表拼接
        int a = 10;
        int b = 20;
        System.out.println("a="+a+"b="+b);
        System.out.println("test:"+a+b);//字符串拼接时整体都是字符串
        System.out.println("test:"+(a+b));
        System.out.println(a+b+"test2");//在字符串中，使用+时，代表拼接
    }
    public static void main13(String[] args) {
        byte a = 10;
        byte b = 20;
        //对于小于4个字节的数据参与运算时，都会被提升为整形
        //byte c = a + b;
        int c = a + b;
        //System.out.println(c);
    }
    public static void main12(String[] args) {
        int a = 10;
        long b = 20;
        //int c = a + b;
        long c = a + b;
    }
    public static void main11(String[] args) {
        int a = 10;
        long b = 100L;
        //a = (int)b;
        b = a;
    }
    public static void main10(String[] args) {
        boolean flg1 = true;
        boolean flg2 = false;
        System.out.println(flg1);
        System.out.println(flg2);
    }
    public static void main9(String[] args) {
        char ch1 = 'A';//2个字节  Character  0-65535
        char ch2 = '男';
        System.out.println(ch1);
        System.out.println(ch2);
    }
    public static void main8(String[] args) {
        float f = 19.9f;
        System.out.println(f);
    }
    public static void main7(String[] args) {
        double d = 12.5;
        System.out.println(d);
        int a = 1;
        int b = 2;
        System.out.println(a / b);

        double num = 1.1;
        System.out.println(num * num);
    }
    public static void main6(String[] args) {
        byte b = 10;//1 -2^7   2^7-1
        System.out.println(b);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }
    public static void main5(String[] args) {
        short a = 10;//2  -2^15    2^15-1
        short b = 32767;
        System.out.println(a);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);

    }
    public static void main4(String[] args) {
        //长整型 8个字节
        long l = 12L;
        System.out.println(l);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);
    }
    public static void main3(String[] args) {
        //int a = 2147483648;
        int a2 = Integer.MAX_VALUE+1;
        //System.out.println(a);
        System.out.println(a2);
    }
    public static void main2(String[] args) {
        int a = Integer.MAX_VALUE;
        int b = a+1;
        System.out.println(b);
    }
    public static void main1(String[] args) {
        int a = 0;
        System.out.println(a);
        a = 100;
        System.out.println(a);
        a = 99;
        System.out.println(a);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);
    }
}
